#include <stdio.h>
#include <string.h>

int is_pal(char *str) {
    int len = strlen(str);
    for (int i = 0; i < len / 2; i++) {
        if (str[i] != str[len - 1 - i]) {
            return 0; 
        }
    }
    return 1; 
}

void remove_suffix(char *word) {
    int len = strlen(word);
    const char *suffixes[] = {"s", "er", "ly", "ed", "ing"};
    int num_suffixes = sizeof(suffixes) / sizeof(suffixes[0]);
    
    for (int i = 0; i < num_suffixes; i++) {
        int suffix_len = strlen(suffixes[i]);
        if (len > suffix_len && strcmp(word + len - suffix_len, suffixes[i]) == 0) {
            word[len - suffix_len] = '\0'; 
            break; 
        }
    }
}

int main() {
    char word[1001];
    scanf("%s", word);
    
    remove_suffix(word);
    printf("%s\n", word);
    
    if (is_pal(word)) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    
    return 0;
}